import request from '@/utils/request.js'

/*公告api*/



/*
 *获取公告分类
 */
export function getNoticeClasses() {
	return request({
		url: '/index/affichetypelist',
		method: 'POST',
	})
}


/**
 * 获取公告列表
 */
export function getNoticeList(data) {
	return request({
		url: '/index/afficheList',
		method: 'POST',
		data
	})
}
/**
 * @param {Object} data
 * 获取是否绑定微信
 */
export function bindwx_pusercode(data) {
	return request({
		url: '/user/bindwx_pusercode',
		method: 'POST',
		data
	})
}




/**
 * 获取公告详情
 */
export function getNoticeDetails(id) {
	return request({
		url: '/index/afficheDetail/ids/' + id,
		method: 'POST',
	})
}

/**
 * 获取通知列表
 * @param {*} data 
 */
export function getMessageList(data) {
	return request({
		url: `/user/newList`,
		method: 'POST',
		data
	})
}


/**
 * 已读
 * @param {*} id 
 */
export function readMessage(id) {
	return request({
		url: '/user/readMsgById',
		method: "post",
		data: {
			id
		}
	})
}


/**
 * 阅读全部
 * @param {*} id 
 */
export function readAllMessage(id) {
	return request({
		url: '/user/oneKeyRead',
		method: "post",
	})
}


/*
 *获取新闻分类
 */
export function getNewsClasses() {
	return request({
		url: '/discover/ant_news/category',
		method: "post",
	})
}


/*
 *获取新闻列表
 */
export function getNewsList(data) {
	return request({
		url: '/discover/ant_news/list',
		method: "post",
		data
	})
}

//新闻详情
export function getNewsDetails(id) {
	return request({
		url: '/discover/ant_news/info',
		method: "post",
		data: {
			news_id: id
		}
	})
}

/*
 *获取辟谣列表
 */
export function getWallList(data) {
	return request({
		url: "/discover/rumor_wall/list",
		method: "post",
		data
	})
}
/*
 *发表辟谣
 */
export function sendRumor(data) {
	return request({
		url: "/discover/rumor_wall/release",
		method: "post",
		data
	})
}

/*
 *发表评论
 */
export function sendComment(data) {
	return request({
		url: "/discover/rumor_wall/comment",
		method: "post",
		data
	})
}


/**
 *  获取辟谣详情
 * @param {*} id 
 * @returns 
 */
export function getRumorDetails(id) {
	return request({
		url: "/discover/rumor_wall/info",
		method: "post",
		data: {
			id
		}
	})
}


/**
 * 获取辟谣评论
 */
export function getRumorComment(data) {
	return request({
		url: "/discover/rumor_wall/getcomment",
		method: "post",
		data
	})
}


/**
 * 
 *获取谣言回复
 * 
 *
  **/
export function getRumorReply(data){
	return request({
	url: "/discover/rumor_wall/getReply",
		method: "post",
		data
	})
}

export function indexCarousel(data){
	return request({
	url: "/index/carousel",
		method: "post",
		data
	})
}


